﻿function ReplyMessage(memberno, msgID, parentID)
{   
    var body = $('texta_body').value; 
    $get("valContent").style.display='none';       
    if(body.length <= 0||body.length>2000){$get("valContent").style.display='';return;}
    showProgressBar(true);
    body=body.replace(/</gi,"&lt;");
    WebServices.User.Mail.ReplyMessage(memberno,msgID,parentID,body,onReplyCallback);
}
function Del(pmid,memberno)
{
   $('Rety').value=pmid;
    $("Form1").action = "/Mail/readmail.htm";
    $("Form1").submit(); 
}
function DeleteMessage(pmid,memberno)
{
    $("$divIput$").style.display = "none";
    var title = C1008;
    var body="";
    body="<div class='Popup_button'><input type='button' value='"+C0069+"' id='addOkButton' class='button' onclick=\"Del('"+pmid+"','"+memberno+"')\" />&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' value='"+gCancel+"' id='addCancelButton' class='buttong' onclick='webFailure()'/></div>";
    var obj = {}
    $ShowMessageBox$(title,body,obj,webFailure,300);

}
function webFailure()
{
    $EndMessageBox$();
}
function onReplyCallback(result)//(0：昵称、1：头像、2：时间)
{
    if(result!=null&&result.length>0)
    {
        var tmp= $get("ReplyMailTemp").innerHTML.replace(/\$Avatar\$/gi,"<img src=\""+(result[1]==""?"/Images/No_pic.gif":result[1])+"\"/>");
        tmp = tmp.replace(/\$NickName\$/gi,result[0]).replace(/\$DiffLastUpdate\$/gi,GetFormatDate(gDateFormat,gStrDate2,result[2]));            
        tmp = tmp.replace(/\$ReplyBody\$/gi,EncodeMessage($('texta_body').value.replace(/</gi,"&lt;")));//  
        $("ReplyMailID").innerHTML=$("ReplyMailID").innerHTML+tmp;
        $('texta_body').value="";
    }
//    $('texta_body').value="";
//    window.location.reload();
    showProgressBar(false);        
}

function OtherMail(val)
{
    $('OP').value=val;
    $("Form1").action = "/Mail/readmail.htm?ID="+currID+"&flag="+flag+"&ACount="+AllCount+"&CNo="+currentNo;
    $("Form1").submit();
}